Skip to content

feat: cargo-fuzz scaffolding for parser + solver + codegen (#138)#142

Merged
avrabe merged 2 commits intomainfrom
fix/138-cargo-fuzz-targets
Apr 24, 2026
Merged

feat: cargo-fuzz scaffolding for parser + solver + codegen (#138)#142
avrabe merged 2 commits intomainfrom
fix/138-cargo-fuzz-targets

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 23, 2026

Summary

  • Adds fuzz/ with three libfuzzer-sys targets: parser, solver, codegen-roundtrip
  • New CI: fuzz-smoke (60s/target on PRs) + fuzz-nightly.yml (1h/target daily, corpus cached)
  • Rivet traceability in artifacts/verification.yaml

Targets

Target Calls into Bound
fuzz_aadl_parse spar_syntax::parse UTF-8 only, ≤64 KiB input
fuzz_scheduler_solver spar_solver::milp::solve_milp ≤8 tasks, ≤4 processors
fuzz_codegen_roundtrip spar_codegen::generate fixed AADL fixture, varied CodegenConfig

Notes

  • cargo fuzz build was not run locally (sandbox denied cargo). The fuzz-smoke CI job is the backstop.
  • verifications: was the originally-spec'd YAML key; the file actually uses artifacts: — entries added under the existing key.
  • IDs used: FUZZ-PARSER, FUZZ-SOLVER, FUZZ-CODEGEN linking to the real REQ-* IDs found in artifacts/requirements.yaml.

Test plan

  • fuzz-smoke CI job passes (compiles + 60s soak per target)
  • rivet validate clean
  • Three PR-checks (Format, Clippy, Test) green

🤖 Generated with Claude Code

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Adds `fuzz/` with three libfuzzer-sys harnesses and the CI plumbing to
gate them:

- `fuzz_aadl_parse`         arbitrary bytes -> `spar_syntax::parse`
- `fuzz_scheduler_solver`   bounded `TaskSet` -> `solve_milp`
- `fuzz_codegen_roundtrip`  deterministic AADL + arbitrary knobs -> `generate`

CI:
- `fuzz-smoke` job in ci.yml runs 60s per target on PRs
- `fuzz-nightly.yml` runs 1h per target daily at 03:00 UTC, caches and uploads corpus

Traceability in `artifacts/verification.yaml`: `FUZZ-PARSER`, `FUZZ-SOLVER`,
`FUZZ-CODEGEN` link to existing REQ-PARSE-*, REQ-PARSER-*, REQ-SOLVER-*,
REQ-CODEGEN-* requirements.

Closes #138.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@avrabe avrabe force-pushed the fix/138-cargo-fuzz-targets branch 2 times, most recently from f4ad049 to e7f76d1 Compare April 24, 2026 04:29
cargo-fuzz defaults to x86_64-unknown-linux-musl. musl's statically-
linked libc is incompatible with ASan:

  sanitizer is incompatible with statically linked libc,
  disable it using `-C target-feature=-crt-static`

Two fixes would work: (1) install musl + disable static libc via RUSTFLAGS,
(2) pin --target x86_64-unknown-linux-gnu explicitly. Going with (2) —
simpler and the CI runner has no need for musl's static-binary benefit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@avrabe avrabe force-pushed the fix/138-cargo-fuzz-targets branch from e7f76d1 to 4d01931 Compare April 24, 2026 04:29
@avrabe avrabe merged commit 0a07f91 into main Apr 24, 2026
12 checks passed
@avrabe avrabe deleted the fix/138-cargo-fuzz-targets branch April 24, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant